<?php
$compchecked = '';
$trainerResponse = MakeQuery::trainerResponseRate($model->users_id, $model->backend_user_id);
if (!empty($compareIds)) {
    $display = '';
    if (in_array($model->id . "@course", $compareIds)) {
        $compchecked = 'checked="checked"';
    }
} else {
    $display = 'none';
}
$this->renderPartial('/compare/_view', array('compareIds' => $compareIds, 'classmodel' => $model, 'display' => $display));
?>

<section class="main-content classes-set class-top">
    <div class="container">  
        <div class="row">   
            <div class="col-lg-12 column12">         
                <div id="Bread">
                    <ol class="breadcrumb">
                        <li><a href="<?php echo SITE_URL; ?>">Home</a></li>
                        <li class="active"><?php echo $model->course_titile; ?></li>
                    </ol>
                </div><!--bread-->
            </div> <!--basket col--> 
        </div><!--breadcrumb row ends here-->  
        <div class="row">
            <div class="basket-left col-md-5 column5 col-sm-12 col-xs-12 column5">
                <figure id="basket">
                    <?php $imageName = (ClassImage::getCoursesPrimaryImage($model->id) != '') ? getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . 'details-image/' . ClassImage::getCoursesPrimaryImage($model->id) : getWorkNoshopimage(SkillConfig::skill_deatils_no_image); ?>
                    <img src="<?php echo $imageName; ?>" alt="<?php echo $model->course_titile; ?>" class="img-responsive">
                    <?php Yii::app()->clientScript->registerMetaTag($imageName, '', null, array('id' => 'meta-image', 'property' => 'og:image'), 'meta_og_image'); ?> 
                    <!--                    <figcaption id="basket_caption">
                    <?php #echo $discount; ?>
                                        </figcaption>-->
                </figure><!-- basket -->
            </div><!--basket left end here--> 
            <div class="basket-right col-md-7  column7 col-sm-12 col-xs-12 column7">
                <div id="basket_content">
                    By <?php echo CHtml::link('<span>'. $userDetails->first_name . '  ' . $userDetails->last_name.'</span>', $this->createAbsoluteUrl('users/trainerProfile/', array('authKey' => $model->auth_key))); ?>
                    <h3><?php echo $model->course_titile; ?></h3> 
                    <p><?php #echo substr($model->course_short_description, 0, 70);   ?></p>
                    <hr> 
                    <ul id="content_flist">
                        <li><?php echo $priceRange; ?></li>
                        <li><span><?php echo $seats; ?></span> Seats</li>
                        <?php if (!empty($userDetails->knowlarity_ext_no)) { ?><li class="liborder"><a href="tel:<?php echo Message::knowlarity_extension;
                        ;
                            ?>" class="calltoaction">Call: <?php echo Message::knowlarity_extension . ' ' . $userDetails->knowlarity_ext_no; ?></a></li><?php } ?>
                    </ul>
                    <div class="row">
                        <div class="meter col-lg-7 column7 col-md-7 col-sm-12 col-xs-12 column7">
                            <ul id="content_slist">
                                <li>
                                    <span></span><!--span for logo grab from background-->
                                    Sessions
                                    <small><?php echo Courses::countCousrseBatchDateSession($model->id); ?></small>
                                </li>
                                <li>
                                    <span class="<?php echo $cssLevel; ?>"></span><!--span for logo grab from background-->
                                    level
                                    <small><?php echo $levelType; ?></small>
                                </li>
                                <li>
                                    <span></span><!--span for logo grab from background-->
                                    RESPONSE RATE
                                    <small><?php echo!empty($trainerResponse) ? $trainerResponse : 0; ?> %</small>
                                </li>
                            </ul><!--content_slist-->
                        </div><!--meter div end here-->
                        <div class=" col-lg-5 col-md-5 column5 col-sm-12 col-xs-12 column5" > 
                            <div id="progress-main"> 
                                <div class="progress">
                                    <div class="progress-bar progress-bar-first" style="width: <?php echo $funLearing->fun; ?>%">
                                        <span class="sr-only"><?php echo $funLearing->fun; ?>% Complete (first)</span>
                                    </div>
                                    <div class="progress-bar progress-bar-second" style="width: <?php echo $funLearing->learn; ?>%">
                                        <span class="sr-only"><?php echo $funLearing->learn; ?>% Complete (second)</span>
                                    </div>
                                    <ul class="progress-perc">
                                        <li><?php echo $funLearing->fun; ?>%</li>
                                        <li><?php echo $funLearing->learn; ?>%</li>
                                    </ul>
                                </div><!--progress-->
                                <ul id="progress-content">
                                    <li>fun quotient</li>
                                    <li>learn quotient</li>
                                </ul>   
                            </div><!--progress main div-->
                        </div><!--progress-main col-->
                    </div><!--content-slist row-->
                    <hr>
                    <form role="form">
                        <div class="form-group">
                            <div class="checkbox basket-check">
                                <label for="<?php echo $model->id; ?>"> <input  type="checkbox" <?php echo $compchecked; ?>  id="<?php echo $model->id; ?>" class="comareclass comareclass_<?php echo $model->id; ?>" value="<?php echo $model->id; ?>"> 
                                Add to Compare </label>
                            </div>
                            <div >
                                <?php
                                $this->widget('application.extensions.SocialShareWidget.SocialShareWidget', array(
                                    'url' => SITE_URL . '/courses-' . $model->id . '/' . $model->course_seo_title, //required
                                    //'services' => array('facebook,', 'twitter','google' ), //optional
                                    'htmlOptions' => array('class' => ''), //optional
                                    'popup' => true, //optional
                                ));
                                ?>
                            </div>
                        </div> <!--form-group--> 
                    </form>
                    <hr>
                    <ul id="basket-button">
                        <li><?php if ($seats > 0) { ?><a href="javascript:void(0);" id="mybook"><?php echo Message::MAKE_QUERY; ?></a><?php } else { ?><a href="javascript:void(0);" ><?php echo 'session close'; ?></a><?php } ?></li>
                        <li><?php echo CHtml::link('Recommend to friend', $this->createAbsoluteUrl('RecommendToUser/create/', array('id' => $model->id, 'type' => 'courses'))); ?></li>
                        <!--                        <li><a href="">Gift this class</a></li>-->
                    </ul>
                </div> <!--basket content-->                  
            </div><!--basket right end here-->
        </div><!--basket main row-->   
    </div> <!-- container -->   
</section>
<div class="clearfix"></div>

<div class="gap2"></div>
<div class="clearfix"></div>
<section class="main-tab classes-cont">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-md-8 column8 col-sm-8 column8 col-xs-12 column8 classes-padl">
                <ul class="nav nav-tabs my_nav">
                    <li class="active"><a data-target="#information" data-toggle="tab">Information</a></li>
<!--                    <li><a data-target="#trainer" data-toggle="tab">Trainer</a></li>-->
                    <li><a data-target="#review" data-toggle="tab">Reviews</a></li>
                    <li><a data-target="#picture" data-toggle="tab">Photos</a></li>
                    <li><a data-target="#venue"  id="myvbatch"data-toggle="tab">Venue and Batch Details</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane fade in active" id="information">
                        <div class="infor-content">
                            <h5>Course Description</h5>
                            <p> <?php echo $model->course_description; ?></p>

                            <h5>Course Outcome</h5>
                            <p> <?php echo $model->course_outcome; ?></p>
                            <h5>Prerequisities</h5>
                            <p> <?php echo $model->course_prerequisites; ?></p>
                            <div class="gap" ></div>
                            <div class="clearfix" style="color:black"> <?php echo Disclaimer; ?></div>  
                        </div> <!--infor-content end here-->  
                    </div><!--information tab pane end here-->

<!--                    <div class="tab-pane fade" id="trainer">
                        <div class="trainer-content">
                            <?php /* ---------render page userPage for userDetails all  review start ---------------- */ ?>
                            <?php #$this->renderPartial('/users/userDetails', array('userDetails' => $userDetails, 'imagePath' => $imagePath, 'classmodel' => $model, 'userType' => $userType, 'classTrainerRate' => $classTrainerRate)); ?>
<?php /* ---------render page userPage for userDetails end---------------- */ ?>
                        </div> trainer-content end here  
                    </div>trainer tab end here-->

                    <div class="tab-pane fade" id="review">
                        <div class="review-content">
                            <?php
                            $reviewdetails = Reviews::getAllReview('courses_id', $model->id);
                            if (!empty($reviewdetails)) {
                                foreach ($reviewdetails as $key => $value) {
                                    $profile = Users::getFrontEndUser($value->users_id);
                                    $imgsrc = ($userDetails->photo <> "") ? getRequestbaseUrl() . getuploadFolderDir() . $profile->user_id . '/profile/minithumb/' . $profile->photo : getWorkNoshopimage(SkillConfig::skill_myinbox_image);
                                    ?>

                                    <div class="single-reviewtab">
                                        <a href="<?php echo $this->createAbsoluteUrl('users/trainerProfile/', array('authKey' => $model->auth_key)); ?>">
                                            <img src="<?php echo $imgsrc; ?>" alt="">
                                            <div class="reviewtab-info">
                                                <div class="review-name"><?php echo $profile->first_name . '   ' . $profile->last_name; ?></div>
                                                <div id="review-title1"><?php echo $value->reviews_text; ?></div>
                                                <div id="review-published1"><span id="review-date1"> <?php #echo date('Y-m-d', strtotime($value->create_time));       ?></span><span class="review-time"><?php
                                                        # echo date('hh-mm-ss', strtotime($value->create_time));
                                                        ;
                                                        ?><?php echo date('Y-m-d', strtotime($value->create_time)); ?></span></div>
                                            </div>
                                        </a>
                                    </div>                            
                                    <?php
                                }
                            } else {
                                echo '<div class="single-reviewtab"> <div class="reviewtab-info"><div class="review-name errorMessage">' . Message::NO_REVIEWS_MSG_COURSE . '</div></div></div>  ';
                            }
                            ?>

                            <!--single-reviewtab-->
                        </div> <!--review-content end here-->  
                    </div><!--review tab ends here-->

                    <div class="tab-pane fade" id="picture">
                        <div class="picture-content">
                            <div id="owl-pictab" class="owl-carousel owl-theme">                                
                                <?php
                                $classWithImage = Courses::getCourseWithImage($model->id);
                                if (!empty($classWithImage)) {
                                    $i = 1;
                                    foreach ($classWithImage as $value) {
                                        $imageName = getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . 'slider-image/' . $value['photo'];
                                        ?>
                                        <div class="item">
                                            <a href="#"><img src="<?php echo $imageName; ?>" alt="" class="img-responsive"></a>
                                        </div>
                                        <?php
                                        $i++;
                                    }
                                } else {
                                    ?>
                                    <div class="item">
                                        <a href="#"><img src="<?php
                                            echo getWorkNoshopimage(SkillConfig::skill_slider_ni_image);
                                            ;
                                            ?>" alt="" class="img-responsive"></a>
                                    </div>
                                <?php }
                                ?>
                            </div><!--owl-pictab-->
                        </div><!--picture-content end here-->  
                    </div><!--picture tab end here-->
                    <div class="tab-pane fade" id="venue">   
                        <?php /* ---------render page classBatch for _venueBatchDetails all  review start ---------------- */ ?>
                        <?php $this->renderPartial('/courseBatche/_venueBatchDetails', array('model' => $model, 'seats' => $seats)); ?>

<?php /* ---------render page classBatch for _venueBatchDetails end---------------- */ ?>
                        <a id="venueBatchscroll"></a>

                    </div>
                </div>
            </div><!--coloumn tab of nav tab end here-->
            <!--   book form start main tab section continue-->
            <div class="col-lg-4 col-md-4 column4 column4 col-sm-4 col-xs-12 classes-padr">
<?php $this->renderPartial('/makeQuery/_form_course', array('type' => 'courses', 'model' => $makeQueryModel, 'timingMakequeryModel' => $timingMakequeryModel, 'classModel' => $model, 'seats' => $seats)); ?>

                <!--book form ends here-->                    
            </div><!--book form coloumn div end here-->
        </div><!--main-tab row-->
    </div><!--main tab container-->
</section>
<div class="clearfix"></div>
<!--=================== main tab end ================================-->
<div class="gap2"> </div>
<div class="clearfix"></div>
<!--====   3. Review and query section start from here===========-->
<section class="review-main classes-cont">
    <div class="container">
        <div class="row">
            <div class="col-lg-5 col-md-5 column5 col-sm-5 column5">
                <!-- 
                  add review section start here
                -->
                <div class="add-review">
                    <div class="container">
                        <h4>Add review</h4>
                        <hr>
                        <?php /* ---------render page reviewpage for write review start ---------------- */ ?>
                        <?php $this->renderPartial('/reviews/_form', array('model' => $model, 'classcoursetype' => 'courses')); ?>
<?php /* ---------render page reviewpage end---------------- */ ?>
                    </div><!--container-->
                </div> <!--add-review end here-->   
                <section class="review">
                    <div class="container">
                        <h4>Reviews</h4>
                        <?php
                        $reviewdetails = Reviews::getAllReview('courses_id', $model->id);
                        if (!empty($reviewdetails)) {
                            ?>
                            <a href="<?php echo Yii::app()->createAbsoluteUrl('reviews/userreviews', array('type' => SkillConfig::course_name, 'workshop' => $model->id,)); ?>" id="review-all">see all</a>
                            <a class="carousel-control left" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-up review-control"></span></a>
                            <a class="carousel-control right" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-down review-control"></a>
<?php } ?> <hr>  
                        <div id="myCarousel" class="carousel slide vertical"> 
                            <div class="carousel-inner">
                                <?php $this->renderPartial('/reviews/_viewReviewCourse', array('model' => $model)); ?>
<?php echo ' <div class="single-review"><div class="review-info" id="reviews_text_success"></div></div>'; ?>

                            </div><!--inner carousel end here-->
                        </div> 
                    </div><!--container class-->  

                </section><!--review ends here-->  
            </div><!--review col end here -->

            <!--query form start from here-->
            <div class="col-lg-7 column7 col-md-7 col-sm-7 column7 classes-padr">
                <section class="recomend">
                    <h3>Recommendations</h3>
                    <div class="recomend-sec">
                        <div class="container">
                            <div class="recomend-people">
                                <span><?php echo (!empty($classtotalCountTrainerate)) ? $classtotalCountTrainerate : '0 '; ?></span>
                                People recommend this
                            </div>
                            <div class="recomend-rating">
                                Rating: <span> <?php echo (!empty($classTrainerRate)) ? $classTrainerRate . ' %  ' : '0  %  '; ?></span>Positive

                            </div>
                        </div> 
                    </div>
                </section><?php /*
                <section class="query-form">
                    <div class="container">
                        <div class="col-lg-12">
                            <h4>Was the information on the page sufficient?</h4>                 
                            <hr>
                        </div>
                        <div class="row"> 
                            <div id="ajaxLoder_<?php echo $model->id; ?>" style="margin: 100px 30px 30px 30px;width: 50%; display: none; float: right;"><img src="<?php echo ThemePath(); ?>/images/myskill.gif"></img></div>
                            <div class="col-lg-12 have-query">
                                <h5>Class description</h5>
                                <?php
                                $likeDesc = ClassCourseContentLikeUnlike::likeClassCourseDescription($model->id, 1, 'courses_id');
                                $unlikeDesc = ClassCourseContentLikeUnlike::UnlikeClassCourseDescription($model->id, 2, 'courses_id');
                                $likestruct = ClassCourseContentLikeUnlike::likeClassCourseStruture($model->id, 1, 'courses_id');
                                $unlikestruct = ClassCourseContentLikeUnlike::UnlikeClassCourseStruture($model->id, 2, 'courses_id');
                                $likeOutCome = ClassCourseContentLikeUnlike::likeClassCourseOutcome($model->id, 1, 'courses_id');
                                $unlikeOutCome = ClassCourseContentLikeUnlike::UnlikeClassCourseOutcome($model->id, 2, 'courses_id');
                                ?>
                                <p class="thumbs-attr">
                                    <a href="javascript:void(0);" id="rlike_1_1" <?php if (empty($likeDesc) && empty($unlikeDesc)) { ?>onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::DESCRIPTION_CLASS_COURSE; ?>, 'course', 1)" <?php } ?>>
                                        <span class="glyphicon glyphicon-thumbs-up hands-click <?php
                                        if (!empty($likeDesc)) {
                                            echo 'likeClass';
                                        }
                                        ?>" id="like_1_1"></span></a>
                                    <a href="javascript:void(0);"  id="rlike_1_2" <?php if (empty($likeDesc) && empty($unlikeDesc)) { ?>onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::DESCRIPTION_CLASS_COURSE; ?>, 'course', 2)" <?php } ?>>
                                        <span class="glyphicon glyphicon-thumbs-down hands <?php
                                        if (!empty($unlikeDesc)) {
                                            echo 'unlikeClasss';
                                        }
                                        ?>" id="like_1_2"></span></a>
                                </p>
                            </div>   
                            <div class="col-lg-12 have-query">
                                <h5>Class Structure</h5>
                                <p class="thumbs-attr">
                                    <a href="javascript:void(0);" id="rlike_2_1" <?php if (empty($likestruct) && empty($unlikestruct)) { ?>onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::STRUCTURE_CLASS_COURSE; ?>, 'course', 1)" <?php } ?>>
                                        <span class="glyphicon glyphicon-thumbs-up hands-click <?php
                                        if (!empty($likestruct)) {
                                            echo 'likeClass';
                                        }
                                        ?>" id="like_2_1"></span></a>
                                    <a href="javascript:void(0);" id="rlike_2_2" <?php if (empty($likestruct) && empty($unlikestruct)) { ?>onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::STRUCTURE_CLASS_COURSE; ?>, 'course', 2)" <?php } ?>>
                                        <span class="glyphicon glyphicon-thumbs-down hands <?php
                                        if (!empty($unlikestruct)) {
                                            echo 'unlikeClasss';
                                        }
                                        ?>" id="like_2_2"></span></a>
                                </p>
                            </div> 
                            <div class="col-lg-12 have-query">
                                <h5>Class Outcome</h5>
                                <p class="thumbs-attr">
                                    <a href="javascript:void(0);" id="rlike_3_1" <?php if (empty($likeOutCome) && empty($unlikeOutCome)) { ?>onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::OUTCOME_CLASS_COURSE; ?>, 'course', 1)"  <?php } ?>>
                                        <span class="glyphicon glyphicon-thumbs-up hands-click <?php
                                        if (!empty($likeOutCome)) {
                                            echo 'likeClass';
                                        }
                                        ?>" id="like_3_1"></span></a>
                                    <a href="javascript:void(0);" id="rlike_3_2" <?php if (empty($likeOutCome) && empty($unlikeOutCome)) { ?>onclick="likeUnlikeClassCourseContent(<?php echo $model->id; ?>,<?php echo SkillConfig::OUTCOME_CLASS_COURSE; ?>, 'course', 2)" <?php } ?>>
                                        <span class="glyphicon glyphicon-thumbs-down hands <?php
                                        if (!empty($unlikeOutCome)) {
                                            echo 'unlikeClasss';
                                        }
                                        ?>" id="like_3_2"></span></a>
                                </p>
                            </div> 

                        </div>  </div>
                </section><!--query form ends here-->*/?>
            </div><!--query from column div end here-->
            <div class="gap2"> </div>
        </div><!--review-main row end here-->
    </div><!--container review end here-->
</section><!--review main end here--> 
<div class="clearfix"></div>
<?php /*
<div class="classes-cont"> 
    <div class="row">
        <div class="container">
            <div class="col-lg-5 col-md-5 column5 column5 col-sm-12 col-xs-12 classes-padl">  
                <section class="tag">
                    <h3>tags</h3>
                    <div class="row">
                        <?php
                        /* --------------------code for write class tag------------------------------------- 
                        foreach ($classTag as $key => $value) {
                            if (!empty($value)) {
                                echo '<a href="#">#' . $value . '</a>';
                                echo '<span class="hastag">#' . $value . '</span>';
                            }
                        }
                        ?>

                    </div>   
                </section><!--tag ends here-->
            </div>      

            <div class="col-lg-7 col-md-7 column7 col-sm-12 col-xs-12 classes-padr">
                <section class="recomend">
                    <h3>Recommendations</h3>
                    <div class="recomend-sec">
                        <div class="container">
                            <div class="recomend-people">
                                <span><?php echo (!empty($classtotalCountTrainerate)) ? $classtotalCountTrainerate : '0 '; ?></span>
                                People recommend this
                            </div>
                            <div class="recomend-rating">
                                Rating: <span> <?php echo (!empty($classTrainerRate)) ? $classTrainerRate . ' %  ' : '0  %  '; ?></span>Positive

                            </div>
                        </div> 
                    </div>
                </section><!--recomend end here-->
            </div>
        </div>
        <div class="gap"></div>
        <div class="gap2"></div>
    </div><!--row-->
</div><!--classes cont-->*/?>
<div class="clearfix"></div>
<!--==================review and query section end here===================  -->
<!--================people like us slider start here========================-->
<?php
$likeClassCourse = peoplelikedClassCourse();
if (!empty($likeClassCourse)) {
    $this->renderPartial('//classes/_likeClassCourse');
}
?>

<!--================people like us slider end here========================-->
<?php
$allClassCourseInfo = array();
$classDetails = getAllliteralEndingTommorowWorkshop('', '', '', LITERAL_ENDING_RENDER_PAGE_LIMIT);
$courseDetails = getAllliteralEndingTommorowCourses('', '', '', LITERAL_ENDING_RENDER_PAGE_LIMIT); //Null parameter means these value $profiles, $userType, $getValue)
$allClassCourseInfo = array_merge($classDetails, $courseDetails);
usort($allClassCourseInfo, 'date_compare');
if (!empty($allClassCourseInfo)) {
    $this->renderPartial('/classes/literallyEndingtomorrow', array('allClassCourseInfo' => $allClassCourseInfo));
}
?>

<?php /* code for slider People who liked this Literally Ending tomorrow */ ?>
<div class="gap"></div>

<div class="clearfix"></div>
<script>
    function likeUnlikeClassCourseContent(classid, type, classcoursetype, status) {
        jQuery.ajax({
            'type': 'POST',
            'url': "<?php echo Yii::app()->createAbsoluteUrl("ClassCourseContentLikeUnlike/savelikeUnlikeClassCourseContent"); ?>",
            'data': 'YII_CSRF_TOKEN=' + $('input[name="YII_CSRF_TOKEN"]').val() + "&type=" + type + "&classcourseId=" + classid + "&classcoursetype=" + classcoursetype + "&status=" + status,
            'beforeSend': function(jqXHR, settings) {
                $("#ajaxLoder_" + classid).show();
            },
            'success': function(data) {
                if (data == 1) {
                    $("#ajaxLoder_" + classid).hide();
                    if (status == 1) {
                        var statusval = status + 1;
                        $("#rlike_" + type + '_' + status).removeAttr("onclick");
                        $("#rlike_" + type + '_' + statusval).removeAttr("onclick");
                        $("#like_" + type + '_' + status).addClass('likeClass');
                    } else {
                        var statusval = status - 1;
                        $("#rlike_" + type + '_' + status).removeAttr("onclick");
                        $("#rlike_" + type + '_' + statusval).removeAttr("onclick");
                        $("#like_" + type + '_' + status).prev('a').removeAttr("onclick");
                        $("#like_" + type + '_' + status).addClass('unlikeClasss');
                    }
                }

            },
            'cache': false
        });

    }

    function RemoveCompareList(classcourseid, class_courseType) {
        var checkboxid = classcourseid;
        var classcourseid = classcourseid + "@" + class_courseType;
        $.post("<?php echo Yii::app()->createUrl("/compare/RemovecompareclasscourseById"); ?>",
                {'YII_CSRF_TOKEN': $('input[name="YII_CSRF_TOKEN"]').val(), class_course_id: classcourseid, class_course_type: class_courseType},
        function(resultclass) {
            if (resultclass == 0) {
                $('.comareclass_' + checkboxid).attr('checked', false); // Unchecks it
                $("#ajax-loader").hide();
                $("#comapre_div_id").hide();
            } else {
                 $('.comareclass_' + checkboxid).attr('checked', false); 
                $("#ajax-loader").hide();
                $(".cartcomapretext").html('');
                $(".cartcomapretext").html(resultclass);
            }
        });
    }
    $(".comareclass").click(function() {
        $("#copareloader").show();
        if ($(".comareclass").is(':checked')) {
            $.post("<?php echo Yii::app()->createUrl("/compare/CompareclassAddClassById"); ?>", {'YII_CSRF_TOKEN': $('input[name="YII_CSRF_TOKEN"]').val(), classcoursetype: 'course', class_course_id: $(".comareclass").attr('id')},
            function(resultclass) {
                $("#comapre_div_id").show();
                var comparedata = resultclass.split('#@#');
                var className = comparedata[0];
                var classImg = comparedata[1];
                var countcomare = comparedata[2];
                if (countcomare > 1) {
                    $(".cartcomapretext").append('<div class="compare-division" id="' + $(".comareclass").attr('id') + '"><div class="thumbnail">' + classImg + '<span>' + className + '</span></div><a href="javascript:void(0)" onclick="RemoveCompareList(' + $(".comareclass").attr('id') + ',\'course\');" class="xlose-button"></a><input type="hidden" class="compareids" name="class_course_id[]" value="' + $(".comareclass").attr('id') + '@course" /></div>');
                    $("#copareloader").hide();
                } else {
                    $(".cartcomapretext").html('<div class="compare-division" id="' + $(".comareclass").attr('id') + '"><div class="thumbnail">' + classImg + '<span>' + className + '</span></div><a href="javascript:void(0)" onclick="RemoveCompareList(' + $(".comareclass").attr('id') + ',\'course\');" class="xlose-button"></a><input type="hidden" class="compareids" name="class_course_id[]" value="' + $(".comareclass").attr('id') + '@course" /></div>');
                    $("#copareloader").hide();
                }
            });
        } else {
            RemoveCompareList($(".comareclass").attr('id'), "course");
        }

    });
    $("#mybook").click(function(event) {
        $("#myvbatch").click();
        $('html, body').animate({scrollTop: $("#venueBatchscroll").offset().top - 620}, 3000);
    });
    $(document).ready(function() {
        $('#metadiscription').attr('content', '');
    })

</script>
<style>
    .likeClass{
        color: green!important;
    }
    .unlikeClasss{
        color:red!important;
    }


</style>
